package project14;

public class Test {
    public static void main(String[] args) {
        Employment a=new Employment("李文骥","202308064502",10000,19);
        arrangment b=new arrangment("杨博天","202308064503",12000,19);
        a.salaryplus();
        b.salaryplus();
        String format=String.format("%.2f",a.getSalary());
        System.out.println("李文骥的薪水:"+Double.parseDouble(format)+" 杨博天的薪水:"+b.getSalary());
    }
}
class Employment
{
    private String name;
    private String workorder;
    private double salary;
    private int age;

    public Employment(String name, String workorder, double salary, int age) {
        this.name = name;
        this.workorder = workorder;
        this.salary = salary;
        this.age = age;
    }
    public double salaryplus()
    {
        salary=salary*(1+0.1);
        return salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public Employment() {
    }
}
class arrangment extends Employment
{
    @Override
    public double salaryplus() {
        double salary =super.getSalary()*(1+0.2);
        super.setSalary(salary);
        return salary;
    }

    public arrangment(String name, String workorder, double salary, int age) {
        super(name, workorder, salary, age);
    }
}